﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Yaml;

namespace Medhurst.Unity.Configuration.Models
{
    public class Behaviours
    {
        public YamlMapping List { get; set; }

        public static Behaviours Load(string yamlString)
        {
            var res = new Behaviours();
            res.List = YamlNode.FromYaml(yamlString).FirstOrDefault() as YamlMapping;
            return res;
        }

        public static Behaviours LoadFile(string path)
        {
            var res = new Behaviours();
            res.List = YamlNode.FromYamlFile(path).FirstOrDefault() as YamlMapping;
            return res;
        }
    }
}
